﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VPN.Manage;
using VPN.DataContext;

namespace VPNNew
{
    public partial class PODetail : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    Guid poid = new Guid(Request.QueryString["POID"]);
                    dvPO.DataSource = new PO[] { POManage.GetPOByPOID(poid) };
                    dvPO.DataBind();
                }
                catch
                {
                    throw new ArgumentException("POID Error", "POID");
                }
            }
        }

        protected void btnPay_Click(object sender, EventArgs e)
        {
            Response.Redirect(string.Format("~/Pay.aspx?POID={0}", Request.QueryString["POID"]), true);
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            Guid poid = new Guid(Request.QueryString["POID"]);
            
        }

        public override string PageCode
        {
            get { return "MyPO"; }
        }


    }
}